home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS in a Box 7
/
BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso
/
Files
/
Prog
/
M
/
Lex.cpt
/
Lex
/
STDIO_LEXLIB.π folder
/
LMOVI_DEBUG.C
< prev
next >
Wrap
Text File
|
1990-06-13
|
2KB
|
56 lines
/*
HEADER: CUG nnn.nn;
TITLE: LEX - A Lexical Analyser Generator
VERSION: 1.0 for IBM-PC
DATE: Jan 30, 1985
DESCRIPTION: A Lexical Analyser Generator. From UNIX
KEYWORDS: Lexical Analyser Generator YACC C PREP
SYSTEM: IBM-PC and Compatiables
FILENAME: LMOVI.C
WARNINGS: This program is not for the casual user. It will
be useful primarily to expert developers.
CRC: N/A
SEE-ALSO: YACC and PREP
AUTHORS: Scott Guthery 11100 leafwood lane Austin, TX 78750
COMPILERS: DESMET-C
REFERENCES: UNIX Systems Manuals
*/
/*
* Bob Denny 28-Aug-82 Remove reference to stdio.h
* Scott Guthery 20-Nov-83 Adapt for IBM PC & DeSmet C
*/
#include <stdio.h>
#include <ctype.h>
#include "lex.h"
_lmovi_debug(ltab_ptr, the_char, state)
register struct lextab *ltab_ptr;
register int the_char;
register int state;
{
int base;
printf((char *)"\nState %d, char %c [%3d] ",
state, isprint(the_char) ? the_char : '*', the_char);
while ((base = ltab_ptr->llbase[state]+the_char) > ltab_ptr->llnxtmax ||
((int *)ltab_ptr->llcheck)[base] != state)
if (state != ltab_ptr->llendst)
{
/*
* This miscompiled on Decus C many years ago
* state = ((int *)ltab_ptr->lldefault)[state];
*/
state = ((int *)ltab_ptr->lldefault)[state];
/* state = base; */
}
else {
printf((char *)"base %d ", base - the_char);
printf((char *)"--> goto final");
return(-1);
}
printf((char *)"base %d ", base - the_char);
printf((char *)"--> goto %d", ((int *)ltab_ptr->llnext)[base] & 0377);
return(((int *)ltab_ptr->llnext)[base]);
}